<?php
/**
 * True Gallery userpanel best template file
 *
 * @version 2.5
 * @author Alexey N. Brin (userxp@joomlaportal.ru)
 * @homepage http://truegallery.ru 
 * @filename userpanel.best.tpl.php
 * @package True Gallery
 * @copyright (C) 2008-2009 by joomlatune.ru
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 * 
 * THIS GALLERY is an EVOLUTION of AkoGallery -> PonyGallery -> DatsoGallery
 *
 * If you fork this to create your own project, 
 * please make a reference to True Gallery someplace in your code 
 * and provide a link to http://www.joomlatune.ru
 *
 **/

defined('_VALID_MOS') or defined('_JEXEC') or die('Direct Access to this location is not allowed.');

?>
<style>
div.true_picture {
	width:130px;
	float:left;
	margin-bottom:5px;
	height:200px;
	border-bottom:1px dotted gray;
}
div.true_picture:hover {
	background-color:#F7F7F7;
}
div.picture_desc,
div.picture_thumb {
	float:left;
	width:100%;
}
div.picture_desc {
}
div.picture_thumb {
	margin-right:5px;
	width:121px;
	height:121px;
}
div.picture_title h1 {
	font-size:1.2em !important;
	padding:0px;
	margin:0px;
	height:38px;
	display:block;
	vertical-align: baseline;
}
div.picture_title h1 a {
	text-decoration:none;
}
div.picture_desc span {
	display:block;
	line-height:1.2em;
	font-size:0.9em;
	color:#777 !important;
	/*margin-left:0px;*/
}
</style>
<div align="center">
	<?php //$listnav->nav->writeLimitBox(); ?>
	<?php echo $listnav->html; ?>
	<?php echo $listnav->nav->writeOfCounter();
	//$pageNav->writePagesLinks("$tgurl&task=userpannel"); ?>
</div>
<?php 
$item=0;
$lo = array(
	'view'=>'pictures',
	'task'=>'view',
	'Itemid'=>$Itemid
);
/*$au = array(
	'view'=>'userpanel',
	'task'=>'author',
	'Itemid'=>$Itemid
);*/
foreach( $list as $tpl ) {
	if( !$tpl->votes ) continue;
	else $votes_result = number_format( $tpl->votesum/$tpl->votes, 2 );
	
	//xdump( $tpl );
	$tpl->title		= $tpl->imgtitle;
	$tpl->imgsrc	= buildPictureAjaxLink($tpl->id,$tpl->catid,$Itemid,2, $tpl->imgfilename);
	$tpl->pubdate	= date( "d.m.y [H:m:s]", $tpl->imgdate );
	$lo['catid']	= $tpl->catid;
	$lo['id']		= $tpl->id;
	if( !$tpl->result) $tpl->result = JText::_('TG_NONE');
	$tpl->imglink	= getTGLink( $lo );
	if(true) $tpl->author = '<a href="'.buildAuthorLink( $tpl->owner ).'" title="Images by '.$tpl->author.'">'.$tpl->author.'</a>';
	
	?>
	<div class="true_picture">
		<div class="picture_title">
			<h1><a href="<?php echo $tpl->imglink; ?>"><?php echo $tpl->imgtitle; ?></a></h1>
		</div>
		<div class="picture_thumb count<?php echo $item ?>">
			<a href="<?php echo $tpl->imglink; ?>" rel="lightbox-tour" title="<?php echo $tpl->title; ?>"><img src="<?php echo $tpl->imgsrc; ?>" alt="<?php echo $tpl->title; ?>" /></a>
		</div>
		<div class="picture_desc">
			<!--h1><a href="<?php echo $tpl->imglink; ?>"><?php echo $tpl->imgtitle; ?></a></h1-->
			<span><?php echo JText::_('TG_AUTHOR').': '.$tpl->author; ?></span>
			<!--span><?php echo JText::_('TG_DATE_ADD').': '.$tpl->pubdate; ?></span-->
			<!--span><?php echo JText::_('TG_SIZE_SHORT').': '.$tpl->width.' x '.$tpl->height; ?></span-->
			<span><?php //echo JText::_('TG_DESCRIPTION').': '.$tpl->description; ?></span>
			<span><?php echo JText::_('TG_HITS').': '.$tpl->hits; ?></span>
			<!--span><?php echo JText::_('TG_RATING').': '.$tpl->result.' ('.$tpl->votesum.'/'.$tpl->votes.') '; ?></span-->
			<span><?php echo JText::_('TG_RATING').': '.$votes_result.' ('.$tpl->votes.') '; ?></span>
		</div>
	</div>
	<?php
	$item++;
}
?>
<div align="center">
	<?php echo $listnav->html; ?>
	<?php echo $listnav->nav->writeOfCounter();
	//$pageNav->writePagesLinks("$tgurl&task=userpannel"); ?><br />
</div>
